package code.framework.android.view;

import android.content.Context;
import android.view.View.OnClickListener;
import android.widget.ImageView;

public class ImageViewButtonHandler {

	protected boolean disabled;

	protected ImageView buttonImageView;

	protected int enabledResId;
	protected int disabledResId;

	protected Context mContext;

	public ImageViewButtonHandler(ImageView buttonImageView) {
		this.buttonImageView = buttonImageView;
	}

	public void setDisabled(final boolean disabled) {
		this.disabled = disabled;
		if (disabled) {
			// disabled
			buttonImageView.setImageResource(disabledResId);
		} else {
			// enabled
			buttonImageView.setImageResource(enabledResId);
		}
	}

	public void setOnClickListener(OnClickListener onClickListener) {
		buttonImageView.setOnClickListener(onClickListener);
	}

	public void setButtonImageView(ImageView buttonImageView) {
		this.buttonImageView = buttonImageView;
	}

	public void setEnabledResId(int enabledResId) {
		this.enabledResId = enabledResId;
	}

	public void setDisabledResId(int disabledResId) {
		this.disabledResId = disabledResId;
	}

}
